package com.zhang.authoritycenter.service.impl;

import com.zhang.authoritycenter.service.IAsyncSysLogService;
import com.zhang.authoritycenter.service.ISysLogService;
import com.zhang.infrastructure.api.authority.AddSysLogReqDTO;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

/**
 * description
 *
 * @author zhangFanJun
 * @date 2024-01-03 17:10
 **/
@RequiredArgsConstructor
@Slf4j
@Service
public class AsyncSysLogServiceImpl implements IAsyncSysLogService {

    private final ISysLogService sysLogService;

    @Async("taskExecutor")
    @Override
    public void addSysLog(AddSysLogReqDTO in) {

        in.setBelongType(0);
        sysLogService.addLog(in);
    }
}
